﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace ASKM.Rachao.Model.Facade
{
    public class Admin: BaseFacade
    {
                        
        #region Language

        /// <summary>
        /// Get all Languages
        /// </summary>
        /// <returns>Language</returns>
        public IList<Language> GetLanguages()
        {            
            var query = from x in CtxRachao.Language
                        orderby x.Name
                        select x;

            return query.ToList();
        }

        /// <summary>
        /// Saves a language
        /// </summary>
        /// <param name="l">Language</param>
        public bool SaveLanguage(Language l)
        {
            this.CtxRachao.Language.Add(l);
            return this.CtxRachao.SaveChanges() > 0;
        }


        #endregion


    }
}
